Skip to content

Add last verified script #3154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Dec 13, 2024
Merged

Add last verified script #3154

merged 25 commits into from
Dec 13, 2024

Conversation

svekars
Copy link
Contributor

@svekars svekars commented Nov 8, 2024

  • Add a script that inserts Created On, Last Updated On, Verified On after the title in the tutorials
  • The .json with the tutorials audit data that is used for last verified is stored in the "last-reviewed-data-json" branch and downloaded via a new Makefile command
  • Modified the GH tutorilas-build workflow to fetch all log history.

Copy link

pytorch-bot bot commented Nov 8, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/tutorials/3154

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

✅ No Failures

As of commit a7f8678 with merge base 9242c60 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@svekars svekars added the website Issues related to website rendering label Nov 11, 2024
@svekars svekars marked this pull request as ready for review November 27, 2024 05:42
@svekars svekars requested a review from clee2000 November 27, 2024 05:43
@svekars svekars assigned malfet and unassigned malfet Nov 27, 2024
Copy link
Contributor

@malfet malfet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of unrelated files in this PR (which feels like a good changes on its own)
Please do not put scripts in a top-level folder, create scripts folder or use .jenkins one (which imo can be renamed to scripts, as Jenkins is no longer used for tutorials CI

@@ -0,0 +1,12 @@
:orphan:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this unrelated to PR in question?

@@ -1,3 +1,5 @@
:orphan:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks unrelated

@@ -1,3 +1,5 @@
:orphan:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks unrelated

from bs4 import BeautifulSoup

# Check if the build directory is provided as an argument in the Makefile
if len(sys.argv) < 2:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please follow __main__ code pattern: https://docs.python.org/3/library/__main__.html

Comment on lines 44 to 60
def get_creation_date(file_path):
try:
result = subprocess.run(
["git", "log", "--diff-filter=A", "--format=%aD", "--", file_path],
capture_output=True,
text=True,
check=True,
)
if result.stdout:
creation_date = result.stdout.splitlines()[0]
creation_date = datetime.strptime(creation_date, "%a, %d %b %Y %H:%M:%S %z")
formatted_date = creation_date.strftime("%b %d, %Y")
else:
formatted_date = "Unknown"
return formatted_date
except subprocess.CalledProcessError:
return "Unknown"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels like get_last_updated and get_created could benefit from some refactoring of common code.
And why unknown is an accepted answer? Shouldn't it raise an exception that should be handled elsewhere?

@svekars svekars requested a review from malfet December 2, 2024 21:52
@malfet malfet merged commit 4a0ae38 into main Dec 13, 2024
19 checks passed
@svekars svekars deleted the add-last-reviewed branch December 13, 2024 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla signed website Issues related to website rendering
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants